package io.renren.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.renren.commons.tools.utils.DateUtils;
import io.renren.commons.tools.validator.group.AddGroup;
import io.renren.commons.tools.validator.group.DefaultGroup;
import io.renren.commons.tools.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;

/**
* 预约配置
*
* @author liuyujun 384880231@qq.com
* @since 3.0 2022-01-13
*/
@Data
@ApiModel(value = "预约配置")
public class AppointmentConfigDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID",hidden = true)
    @Null(message="{id.null}", groups = AddGroup.class)
    @NotNull(message="{id.require}", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty(value = "预约开始时间",required = true)
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
    @NotBlank(message="{appointmentConfig.startTime.require}", groups = DefaultGroup.class)
    private Date startTime;


    @ApiModelProperty(value = "预约结束时间",required = true)
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
    @NotBlank(message="{appointmentConfig.endTime.require}", groups = DefaultGroup.class)
    private Date endTime;


    @ApiModelProperty(value = "项目类别",required = true)
    @NotBlank(message="{appointmentConfig.appointmentType.require}", groups = DefaultGroup.class)
    private Integer appointmentType;

    @ApiModelProperty(value = "收费方式")
    @NotBlank(message="{appointmentConfig.payType.require}", groups = DefaultGroup.class)
    private Integer payType;

    @ApiModelProperty(value = "单价")
    @NotNull(message="{appointmentConfig.unitPrice.require}", groups = DefaultGroup.class)
    private Double unitPrice;

    @ApiModelProperty(value = "审核 0：手动    1：自动")
    @Range(min=0, max=1, message = "{appointmentConfig.autoAudit.range}", groups = DefaultGroup.class)
    private Integer autoAudit;

    @JsonIgnore
    private Long tenantCode;

    @ApiModelProperty(value = "租户名称")
    private String tenantName;

    @ApiModelProperty(value = "创建时间",hidden = true)
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Date createDate;

}